package com.epam;

public class MyListTest {

	
	public static void main(String[] args) {
	
	System.out.println("create 3 element MyArrayList");
	MyList myList = new MyArrayList(3);
	System.out.println("add 10 to position 1");
	myList.add(1,10);
	System.out.println(myList);
	System.out.println("add another array to the end of MyArrayList");
	myList.addAll(new Integer[]{1,1,1});
	System.out.println(myList);
	System.out.println("add another array starting at positionn 2 of MyArrayList");
	myList.addAll(2 ,new Integer[]{2,2,2});
	System.out.println(myList);
	System.out.println("remove element at positionn 2 of MyArrayList");
	myList.remove(2);
	System.out.println(myList);
	System.out.println("____________________");
	MyList myLinkedList = new MyLinkedList<Integer>();
	System.out.println("add some elements to MyLinkedList");
	myLinkedList.add(1);
	myLinkedList.add(2);
	myLinkedList.add(3);
	System.out.println(myLinkedList);
	System.out.println("add 4 to the beginning of MyLinkedList");
	myLinkedList.add(0, 4);
	System.out.println(myLinkedList);
	System.out.println("get element at position 0");
	System.out.println(myLinkedList.get(0));
	System.out.println("add array to the beginning of MyLinkedList");
	myLinkedList.addAll(0 ,new Integer[]{9,9,9,8});
	System.out.println(myLinkedList);
	System.out.println("MyLinkedList size");
	System.out.println(myLinkedList.size());
	System.out.println("remove element at position 4");
	myLinkedList.remove(4);
	System.out.println(myLinkedList);
	System.out.println("MyLinkedList size");
	System.out.println(myLinkedList.size());
	}
}
